﻿using AutoMapper;
using Microsoft.Extensions.Caching.Distributed;
using Qianke.Core.Common.Interface;
using Qianke.Core.Saas.Contracts.Models;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Qianke.Core.Saas.Domain
{
    public class AutoMapperProfiles : Profile
    {
        public AutoMapperProfiles()
        {
            CreateMap<ITokenInfo, TokenInfo>();
            CreateMap<TokenInfo, TokenInfo>();

            //var assemblies = AppDomain.CurrentDomain.GetAssemblies();

            //// 查找实现了 IHasName 接口的所有类型
            //var typesWithIHasName = assemblies
            //    .SelectMany(assembly => assembly.GetTypes())
            //    .Where(type => typeof(IHasName).IsAssignableFrom(type) && !type.IsInterface && !type.IsAbstract)
            //    .ToList();

            //// 遍历这些类型并注册到 EntityCache
            //foreach (var entityType in typesWithIHasName)
            //    CreateMap(entityType, typeof(SimpleNameOutputDto));
        }
    }
}
